Skip to content

Batch: 4 changes, one commit each - #28

Merged
thebenignhacker merged 4 commits into
mainfrom
integrate/2026-10-17-r6
Oct 18, 2026
Merged

thebenignhacker merged 4 commits into
mainfrom
integrate/2026-10-17-r6

Conversation

@thebenignhacker

Copy link
Copy Markdown
Member

This pull request lands 4 commits in internal/scanner, internal/analyzer, internal/reporter, pkg/types, cmd/tlsanalyzer, docs/policies.md, README.md and CHANGELOG.md.

Included

Verified on this exact tree

  • git ls-files --others -- '*_test.go': 0 files; git ls-files -- '*_test.go': 92 files
  • go mod verify: all modules verified
  • go build ./...: exit 0
  • go vet ./...: exit 0
  • gofmt -s -l .: 0 files listed
  • golangci-lint run ./... (2.12.2): 17 issues (errcheck 10, staticcheck 6, unused 1)
  • golangci-lint run --new-from-rev=origin/main ./...: 0 issues
  • go test -race -p 4 -count=1 -json -skip '^TestAZoneScopedLinkLocalTargetIsScanned$' ./... (Go 1.26.3): exit 0; 6 packages passed, 0 failed; 399 top-level tests passed, 0 failed, 1 skipped (TestFIPSChildScanNamesTheHybridGroupsItCannotOffer, skip message: "runs in the child process that TestAFIPSBuildWithoutMLKEMNamesTheHybridGroupsItCannotOffer starts"); 527 subtests passed, 0 failed, 0 skipped
  • TestAZoneScopedLinkLocalTargetIsScanned: not run, excluded with -skip (it listens on a link-local IPv6 address)
  • A second run of the same go test command on the same tree: 398 top-level tests passed, 1 failed, 1 skipped; the failure was TestSanitizeForReportCostDoesNotGrowQuadratically, a timing test this batch does not touch, which then passed three times in a row alone with -race -count=3 on this tree and on origin/main
  • Changelog check: the repository has none

Not included

None

Closes

Fixes #23
Fixes #24
Fixes #26
Fixes #27

How to merge

Rebase and merge, so that each change stays its own commit on main.

…r long host names (#23)

When a server rejected every handshake, the error ended with one openssl
s_client command per key exchange group the scanner does not offer, and
each command repeated the address. The CLI prints up to 500 bytes of a
scan error, so a long address pushed the last command past that limit,
and its group was named nowhere else. Measured with Go 1.26.3 against
local servers: run with GODEBUG=fips140=on,tlsmlkem=0, the error for
scanner-target-example.localhost on a five-digit port ended in
"-groups SecP256r1MLKEM768 and openssl s_client -connect sca..." and did
not name SecP384r1MLKEM1024. Without that setting, a 51-character host
name on a five-digit port lost it the same way.

When the commands do not all fit, the error now names the groups
straight after its first sentence and gives only the commands that fit
whole. For both host names above that is the command for the first
group, and the errors are 453 and 478 bytes. An error whose commands fit
is unchanged: against 127.0.0.1 and ::1 on five-digit ports the CLI
prints the same bytes as before.

A test builds the error for every host name length the scanner accepts,
at ports 443 and 65535, and for the longest name after each of the 256
TLS alert values, and finds each group named within the 500 bytes. The
FIPS-mode test also scans a 39-character spelling of 127.0.0.1, and that
check failed on the earlier code.

Fixes #23
With no --sni and a host name too long for the quantum.minQuantumScore
Verify to name twice, the Verify connects to the result's IP. That field
was the first address the host name resolved to, recorded before any
connection, while the scan's dials move on to the next address when the
first one refuses. A TLS 1.3 server listening on 127.0.0.1 only, scanned
under cnsa-2.0-2030 as a 213-character .localhost name that resolves to
::1 and then 127.0.0.1, was measured over 127.0.0.1, reported "ip": "::1",
and its Fix ended with -connect '[::1]:52144', an address the server was
not listening on.

Each probe now records the address of every connection that completed a
handshake, and the result's IP is the one reached first; when one scan's
connections reached more than one address, a scan coverage note names
them. The same scan now reports "ip": "127.0.0.1", the text report's IP
line reads the same, and the 498-byte Fix ends with
-connect 127.0.0.1:50983 -servername <the name> -groups X25519MLKEM768
</dev/null; run as printed, that command reached the server and received
its handshake failure alert for the group it does not offer.

The scanner test scans localhost served on the last of its loopback
addresses only, and the analyzer test repeats the report's scan and checks
the Verify; both skip where the name does not resolve to two loopback
addresses. A unit test covers the note for more than one address.
docs/policies.md and the changelog describe the field.

Fixes #24
The service endpoint in --format cbom output was written from the bare
host and the port with "https://%s:%d", so a scan of '[::1]:8443' listed
https://::1:8443. The endpoint is now built with net.JoinHostPort and
net/url, and that scan lists https://[::1]:8443. A zone-scoped address is
bracketed too, with the % before its zone written %25: fe80::1%lo0 on
port 9 is written https://[fe80::1%25lo0]:9. A host name or an IPv4
address is written as before.

TestCBOMEndpointWritesAnIPv6AddressInBrackets fails in its three IPv6
cases on the earlier code and passes in all five with this change.

Fixes #26
@thebenignhacker
thebenignhacker merged commit 3c89a04 into main Oct 18, 2026
2 checks passed
@thebenignhacker
thebenignhacker deleted the integrate/2026-10-17-r6 branch October 18, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant